package com.atguigu.inner.anymous;

public class TestFather {
    public static void main(String[] args) {
        //抽象类不能直接创建对象
//        Father f = new Father();//错误，不能创建Father类本身的对象

        //创建Father子类的对象，可以是匿名子类
        Father f = new Father() {
            @Override
            public void show() {
                System.out.println("hello" + getName());
            }
        };
        f.show();

        Father f2 = new Father("张三") {
            @Override
            public void show() {
                System.out.println("hi" + getName());
            }
        };
        f2.show();
    }
}
